extends head


block content
    body(ontouchstart)
        div#ordForm(style="background-color: #F5F5F5; overflow: scroll; width:  100%; height: 100%")
            div.list-item(style="max-height: 9rem;!important;" v-for="(ord,index) in orderList")
                div(@click="detail(ord.id)")
                    div(style="border-bottom:2px solid #F5F5F5;margin-top: .2rem;")
                        label.list-label(style="font-size: .7rem; margin-left: 1.2rem;") 订单号:
                        span {{ord.ordNo}}
                    ul.fl(style="max-width: 14.5rem; padding: .3rem .5rem;")
                        li.title
                            span(style="font-size: .7rem;  margin-left: .8rem;margin-right: .2rem;") 寄件人: {{ord.name}}
                            span.phone(style="margin-left: .8rem;") {{ord.phone}}
                        li.address_1 寄件地址:
                            span(style="margin-left: 5px;") {{ord.address1}}
                        li.address_2(style="margin-left: 3.2rem;") {{ord.address2}}
                        li
                            label.list-label 订单价格:
                            span.cost ￥{{ord.price}}
                        li
                            label.list-label 下单时间:
                            span {{ord.ordTime}}



block append footer
    script(type='text/javascript').
        $(function () {
            var ordForm = new Vue({
                el: '#ordForm',
                data: {
                    orderList:[]
                },
                methods: {
                    init: function () {
                        zxlib.fpost('/deli/de/getOrds', {
                            openId:1
                        }, function (data) {
                            var dta = data.data
                            for(dt in dta){
                                var dts = {
                                    id:dta[dt]['id'],
                                    ordNo:dta[dt]['orderNo'],
                                    price:dta[dt]['originalPrice']/100,
                                    address1:dta[dt]['province']+dta[dt]['city']+dta[dt]['district'],
                                    address2:dta[dt]['senderAddress'],
                                    name:dta[dt]['senderName'],
                                    phone:dta[dt]['senderTelephone'],
                                    ordTime:dta[dt]['ordTime']
                                }

                                ordForm.orderList.push(dts);
                            }
                        }, function (data) {
                            console.log(data);
                        });
                    },
                    detail:function (ordId) {
                        location.href = '/deli/de/ordDtl?orderId='+ordId;
                    }
                }
            });

            ordForm.init();
        });